//part1:C05:ex5.5.cpp
#include <iostream>

int main(void) {
  using namespace std;
  int grade;
  cout << "Enter your grade:\n";
  cin >> grade;
  if (grade < 0 || grade > 100) {
    cout << "grade is not good!" << endl;
    return -1;
  }
  if (grade == 100) {
    cout << "grade rank is: " << "A++" << endl;
    return -1;
  }
  if (grade < 60) {
    cout << "grade rank is: " << "F" << endl;
    return -1;
  }
  int iU = grade / 10;
  int iT = grade % 10;
  string score, level, lettergrade;

  if (iU == 9) {
    score = "A";
  }
  else if (iU == 8) {
    score = "B";
  }
  else if (iU == 7) {
    score = "C";
  }
  else {
    score = "D";
  }
  if (iT < 3) {
    level = ""; 
  }
  else if (iT > 7) {
    level = "+";
  }
  else {
    level = "";   
  }

  lettergrade = score + level;
  cout << "grade rank is:" << lettergrade << endl;
    
  return 0;
}
